
<form id="add-form" class="form-horizontal col-sm-12" role="form" data-toggle="validator" method="POST" action="">
	{:token()}
	<input type="hidden" name="row[id]" value="{$row.id}">
	<div class="form-group">
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-workorder_number">工单编号:</label>
				<input id="c-workorder_number" data-rule="required" class="form-control" placeholder="工单编号" name="row[workorder_number]" value="{$row.workorder_number}" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-title">工单标题:</label>
				<input id="c-title" data-rule="required" class="form-control" placeholder="工单标题" name="row[title]" type="text" value="{$row.title}" >
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-customer_id">关联客户:</label>
				<input id="c-customer_id" data-rule="required" class="form-control selectpage" name="row[customer_id]"
					   data-source="qingdongams/common/getCustomer" type="text" value="{$row.customer_id}">

			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-contacts">客户联系人:</label>
				<input id="c-contacts" data-rule="required" class="form-control selectpage" name="row[contacts_id]"
					   data-source="qingdongams/common/getContacts" type="text" value="{$row.contacts_id}">
			</div>
		</div>

		<div class="col-xs-12 col-sm-12">
			<div class="form-group col-sm-12">
				<dl class="fieldlist" data-name="row[product_part]" data-template="testtpl">
					<dd>
						<label>已购产品:</label><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i
							class="fa fa-plus"></i> 选择产品</a>
					</dd>
					<textarea name="row[product_part]" class="form-control hide" cols="30" rows="5"
					>{$row.product_part|json_encode}</textarea>
				</dl>
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label>过保类型:</label>
				{:build_radios('row[is_over]', ['1'=>__('过保'), '2'=>__('未过保')],$row['is_over'])}
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-appointment_time">预约时间:</label>
				<input id="c-appointment_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="预约时间" name="row[appointment_time]" type="text" value="{$row.appointment_time}" >
			</div>
		</div>

		<div class="col-xs-12 col-sm-10">
			<div class="form-group col-sm-10">
				<label>备注:</label>
				<textarea class="form-control" rows="3" name="row[remarks]"
						  placeholder="请输入备注">{$row.remarks}</textarea>
			</div>
		</div>

	</div>

	<div class="form-group layer-footer">
		<label class="control-label col-xs-12 col-sm-2"></label>
		<div class="col-xs-12 col-sm-8">
			<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
		</div>
	</div>
</form>
<!--定义模板-->
<script type="text/html" id="testtpl">
	<dd>
		<div class="form-inline" style="margin-bottom:20px;display: flex;">
			<span>产品名称:<input type="text" data-source="qingdongams/common/getCustomerProduct"
							  class="form-control product selectpage" name="row[<%=name%>][<%=index%>][customer_product_id]"
							  data-field="name" data-primary-key="id" style="width: 300px;"
							  value="<%=row['customer_product_id']%>"/></span>

			<span style="margin-left: 10px"><span class="btn btn-sm btn-danger btn-remove"><i
					class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i
					class="fa fa-arrows"></i></span></span>
		</div>
	</dd>
</script>